package lianxi1;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource("classpath:config.properties")
public class User {
    @Value("${demo.username}")
    private String username;
    @Value("${demo.password}")
    private String password;

    public void sayHello(){
        System.out.println("你好啊");
    }
    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
